In many multi-tasking operating systems, processes are broken up into several threads. A thread is a piece of code executed by the operating system (O/S). The concept of multi-threading is to allow several pieces of code (or threads) in one process to run “concurrently.” For example, if a word processor is running, the user can click on a “find menu item” to cause a pop-up box to appear. This pop-up can be moved and manipulated independent of the main word processor window. Thus, the pop-up does not render the main word processor window inactive. This is an example of two different threads running within the word processor process.
The concept of multi-tasking is similar to multi-threading in that it gives the appearance of multiple pieces of code executing at the same time on a single computer processor. A difference is that multi-tasking refers to more than one process running on the computer and multi-threading refers to more than one thread running within the same process as with the example above.
The appearance of more than one process or thread running concurrently is a result of a multi-tasking scheduler scheduling threads to run in very small time increments, which may be referred to as “quanta.” A quantum is a time slice given to a thread during which time that thread owns a CPU resource. The length of a quantum is in the range of about 20 milliseconds to about 120 milliseconds on contemporary Operating Systems. The exact times may vary depending on the hardware on which the O/S is running. Further, the O/S can change the value of the quantum given to a particular thread. For example, if a thread does not complete during its first quantum, the O/S might increase or decrease the size of the quantum the next time the thread is scheduled to execute.
Due to the small length of a quantum compared to the human perception of time and by executing threads in a round robin fashion, it appears that threads run concurrently. Contemporary multi-tasking O/S schedulers add priorities to threads and various algorithms exist to optimally run the higher priority threads before the lower priority threads. However, all threads are presented to the O/S scheduler for immediate execution and the O/S scheduler to the best of its ability gets all the threads to complete their execution as fast as it can based on their priority.
However, a problem with scheduling in this manner is that computer performance is poorer than might be expected. Often, a process hesitates or even freezes. For example, a process that renders on a display screen based on user input is often unable to render as the user inputs data because another process is consuming too much processor time.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.